<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>颜色渐变</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            float: left;
            margin-left: 10px
            
        }
        .gu1{
            background-image: linear-gradient(to bottom, yellow,red);
        }
        .gu2{
            background-image: linear-gradient(to right, yellow,red);
        }
        .gu3{
            background-image: linear-gradient(135deg, red,yellow);
        }
    </style>
</head>
<body>
    <div class="gu1"></div>
    <div class="gu2"></div>
    <div class="gu3"></div>
</body>
</html>